package com.example.fund.util;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class StringUtil {

	public static boolean isNullOrEmpty(Object obj)
	{
		return obj==null || obj.toString().trim().length()==0;
	}
	
	public static String dealNull(Object obj)
	{
		return obj==null?"":obj.toString();
	}

	public static String dealBigDecimal(double d,int scale)
	{
		if (d==0)
		{
			return "0";
		}
		return new BigDecimal(d).setScale(scale, RoundingMode.HALF_UP).toString();
	}
}
